package 笔试;

public class 一维数组的动态和 {
    public int[] runningSum(int[] nums) {
        int[] res = new int[nums.length];
        int tmp = 0;
        for(int i = 0; i < nums.length; i++) {
            res[i] = tmp + nums[i];
            tmp += nums[i];
        }
        return res;
    }
}
